package com.yanqu.road.entity.activity.fellingtrees.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_ftrees_materials")
public class FellingTreesMaterialsConfig {

    @FieldTypeAnnotation(desc = "活动id", select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "药材ID")
    private int id;
    @FieldTypeAnnotation(desc = "药材图标")
    private String icon;
    @FieldTypeAnnotation(desc = "药材品质")
    private int quality;
    @FieldTypeAnnotation(desc = "随机掉落区间")
    private String dropLevel;
    @FieldTypeAnnotation(desc = "掉落权重")
    private int weight;

    private List<List<Integer>> dropLevelRangeList;

    public void init() {
        List<List<Integer>> listList = new ArrayList<>();
        for (String range : StringUtils.stringToStringList(dropLevel, "\\|")) {
            List<Integer> list = StringUtils.stringToIntegerList(range, ";");
            listList.add(list);
        }
        dropLevelRangeList = listList;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public String getDropLevel() {
        return dropLevel;
    }

    public void setDropLevel(String dropLevel) {
        this.dropLevel = dropLevel;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public List<List<Integer>> getDropLevelRangeList() {
        return dropLevelRangeList;
    }

    public void setDropLevelRangeList(List<List<Integer>> dropLevelRangeList) {
        this.dropLevelRangeList = dropLevelRangeList;
    }
}
